from django.conf.urls import url

from goods import views

from rest_framework.routers import DefaultRouter


urlpatterns = [
    url(r'^categories/$',views.CategoryView.as_view(),),

    # 热销商品
    url(r'^categories/(?P<category_id>\d+)/hotskus/$', views.HotSKUView.as_view(), name='hot'),
    # 商品分类列表
    url(r'^categories/(?P<category_id>\d+)/skus/$',views.SKUListView.as_view(),name='list'),
]



router = DefaultRouter()
router.register('search', views.SKUSearchViewSet, base_name='skus_search')

urlpatterns += router.urls